#SQL Server->CDM->DWS测试场景：
#针对一个源端数据库到一个目标库，针对单表进行测试，表预置30个字段，预存1000万条数据。
#sqlserver创建带主键表同时插入30个字段，表名为sqlserver_source：
CREATE TABLE sqlserver_source (
	id INT PRIMARY KEY,
	datetime datetime NULL,
	test03 INT NULL,
	test04 INT NULL,
	test05 INT NULL,
	test06 INT NULL,
	test07 INT NULL,
	test08 INT NULL,
	test09 INT NULL,
	test10 INT NULL,
	test11 INT NULL,
	test12 INT NULL,
	test13 INT NULL,
	test14 INT NULL,
	test15 INT NULL,
	test16 INT NULL,
	test17 INT NULL,
	test18 INT NULL,
	test19 INT NULL,
	test20 INT NULL,
	test21 INT NULL,
	test22 INT NULL,
	test23 INT NULL,
	test24 INT NULL,
	test25 INT NULL,
	test26 INT NULL,
	test27 INT NULL,
	test28 INT NULL,
	test29 INT NULL,
	test30 INT NULL,)



#使用循环的方式每次插入1行数据，重复333334次：
declare @i int
SET @i=1
while @i <= 333334
	BEGIN 
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i, '2022-03-25 17:30:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
    SET @i=@i+1
End



#使用循环的方式每次插入10行数据，重复100万次，共插入1000万行数据：
DECLARE @N INT
declare @i int
SET @i=1
SET @N=1
while @N <= 1000000
	BEGIN 
	INSERT INTO sqlserver_source(id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+1, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+2, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+3, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+4, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+5, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+6, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+7, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+8, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
	INSERT INTO sqlserver_source (id, datetime, test03, test04, test05, test06, test07, test08, test09, test10, test11, test12, test13, test14, test15, test16, test17, test18, test19, test20, test21, test22, test23, test24, test25, test26, test27, test28, test29, test30
) VALUES (@i+9, '2022-04-07 16:00:00',  3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30);
    SET @i=@i+10
    SET @N=@N+1
End
